package crudfx.interop;
import crudfx.interop.*;
import javafx.ext.swing.*;
import javax.swing.*;
import java.awt.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class UINode extends SwingComponent{
    var jPanel:JPanel;
    public var content:UIComponent on replace  o=n{
        if(o!=null)jPanel.remove(o.getJComponent());
        if(n!=null){
            jPanel.add(n.getJComponent(), java.awt.BorderLayout.CENTER);
            }
        jPanel.validate();
        javax.swing.SwingUtilities.updateComponentTreeUI(jPanel);
        }
    override public function createJComponent():JComponent{
        jPanel=new JPanel();
        jPanel.setOpaque(false);
        jPanel.setLayout(new BorderLayout());
        return jPanel;
        }
}
